package com.jms.tomcat.config;

import com.jms.tomcat.registration.JmsFilterRegistration;

import javax.servlet.FilterConfig;
import javax.servlet.ServletContext;
import java.util.Enumeration;
import java.util.Vector;

public class JmsFilterConfig implements FilterConfig {

    private final JmsFilterRegistration filterRegistration;

    public JmsFilterConfig(JmsFilterRegistration filterRegistration) {
        this.filterRegistration = filterRegistration;
    }
    @Override
    public String getFilterName() {
        return filterRegistration.getName();
    }

    @Override
    public ServletContext getServletContext() {
        return filterRegistration.getServletContext();
    }

    @Override
    public String getInitParameter(String name) {
        return filterRegistration.getInitParameter(name);
    }

    @Override
    public Enumeration<String> getInitParameterNames() {
        return new Vector<>(filterRegistration.getInitParameters().keySet()).elements();
    }
}
